<example name="Data List Ng">
  <file type="html">
    <div ng-app="Example.data-list" ng-strict-di ng-controller="ExampleCtrl as ctrl">
      <rg-data-list
        data="ctrl.data"
        selection="ctrl.selection"
        on-select="ctrl.onSelect"
      ></rg-data-list>
    </div>
  </file>

  <file type="js">
    import angular from 'angular';
    import RingDataList from '@jetbrains/ring-ui/components/data-list-ng/data-list-ng';
    import Selection from '@jetbrains/ring-ui/components/data-list/selection';
    import data from '@jetbrains/ring-ui/components/data-list/data-list.mock.js';

    const exampleModule =  angular.module('Example.data-list', [RingDataList]);

    exampleModule.controller('ExampleCtrl', function () {
      this.data = data;
      this.selection = new Selection({data, isItemSelectable: item => item.selectable});
      this.onSelect = selection => {
        this.selection = selection;
      }
    });
  </file>
</example>
